package com.yan.demo;

public class Test5 {
    public static void main(String[] args) {
        int[] arr = {1, 2, 3, 4, 5,};
        int[] arr1 = {5, 4, 3, 2, 1};
        boolean flag = true;
        if(arr1.length != arr.length){
            flag = false;
            System.out.println("两个数组不相等");
            return;
        }
        for (int i = 0; i < arr.length; i++) {
            if(arr[i] != arr1[i]){
                flag = false;
                System.out.println("两个数组不相等");
                return;
            }
        }
        if(flag){
            System.out.println("两个数组相等");
        }
    }
}
